home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 6 / Amiga Format AFCD06 (Nov 1996, Issue 90).iso / serious / commercial / cloanto / ppaint / rexx / embossanim.pprx < prev    next >
Text File  |  1995-09-18  |  2KB  |  86 lines

  1. /* PPaint Amiga Rexx script - Copyright © 1995 Cloanto Italia srl */
  2.  
  3. /*
  4.   $VER: EmbossFrames.pprx 1.0
  5. */
  6.  
  7.  
  8. MYPORT = 'PPAINT'
  9.  
  10. IF ~SHOW('P', MYPORT) THEN DO
  11.     IF EXISTS('PPaint:PPaint') THEN DO
  12.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  13.         DO 30 WHILE ~SHOW('P',MYPORT)
  14.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  15.         END
  16.     END
  17.     ELSE DO
  18.         SAY "Personal Paint could not be loaded."
  19.         EXIT 10
  20.     END
  21. END
  22.  
  23. IF ~SHOW('P', MYPORT) THEN DO
  24.     SAY 'Personal Paint Rexx port could not be opened.'
  25.     EXIT 10
  26. END
  27.  
  28. ADDRESS VALUE MYPORT
  29. OPTIONS RESULTS
  30. OPTIONS FAILAT 10000
  31.  
  32. Version 'REXX'
  33. IF RESULT < 3 THEN DO
  34.     errmess = 'This script requires a newer_version of Personal Paint.'
  35.     SAY errmess
  36.     RequestNotify 'PROMPT="'errmess'"'
  37.     EXIT 10
  38. END
  39.  
  40. /*
  41.    Change the variable below to use another filter
  42.    and/or edit and use a Set command such as the following one
  43. */
  44.  
  45. filtername = 'Emboss High'
  46.  
  47. /*
  48.    Set '"FILTER = ""Emboss High"", 0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,1,0,-1,  0,0,0,-1,-1,  1, 204,0,0"'
  49. */
  50.  
  51. LockGUI
  52. GetFrameNum
  53. frames = RESULT
  54. IF frames = 0 THEN DO
  55.     RequestFile '"Select Animation"'
  56.     IF RC = 0 THEN DO
  57.         LoadAnim RESULT NEW
  58.         GetFrameNum
  59.         frames = RESULT
  60.     END
  61. END
  62. IF frames > 0 THEN DO
  63.     GetFramePos
  64.     savepos = RESULT
  65.     errorcode = 0
  66.     SetFramePos 1
  67.     DO fnum = 1 TO frames
  68.         Process '"'filtername'"'
  69.         IF RC ~= 0 THEN DO
  70.             IF RC = 5 THEN
  71.                 errmess = 'User abort during processing.'
  72.             ELSE
  73.                 errmess = 'Error 'RC' during processing.'
  74.             errcode = RC
  75.             LEAVE
  76.         END
  77.         SetFramePos NEXT
  78.     END
  79.     IF errcode > 0 THEN DO
  80.         SAY errmess
  81.         RequestNotify 'PROMPT="'errmess'"'
  82.     END
  83.     SetFramePos savepos
  84. END
  85. UnlockGUI
  86.